package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsAdminMapper;
import com.qf.pojo.DtsAdmin;
import com.qf.vo.CatVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author sunyamei
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.service
 * @Description:
 * @Date 2022/7/25 20:18
 */
@Service
public class AdminServiceImpl implements  AdminService{

    @Autowired
    private DtsAdminMapper adminMapper;

    @Override
    public List<DtsAdmin> findAdminByName(String userName) {
        //创建查询条件对象
        QueryWrapper<DtsAdmin> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", userName);

        //查询并返回结果
        List<DtsAdmin> list = adminMapper.selectList(queryWrapper);

        return list;
    }


    /**
     * 下拉
     * @return
     */
    @Override
    public List<CatVo> findAdmin() {
        List<CatVo> admin = adminMapper.findAdmin();
        return admin;
    }
}
